package org.dromara.germbank.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import io.swagger.v3.oas.annotations.media.Schema;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 调研管理-调研管理列表
 * 数据库表名：bus_research_surveys
 */
@Data
@TableName("bus_research_surveys")
public class BusResearchSurveys implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableField("id")
    @NotNull(message = "主键ID不能为空")
    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer id;

    @TableField("survey_name")
    @NotBlank(message = "调研名称不能为空")
    @Length(max = 255, message = "调研名称长度不能超过255")
    @Schema(description = "调研名称", requiredMode = Schema.RequiredMode.REQUIRED)
    private String surveyName;

    @TableField("location")
    @Size(max = 255, message = "调研位置长度不能超过255")
    @Length(max = 255, message = "调研位置长度不能超过255")
    @Schema(description = "调研位置")
    private String location;

    @TableField("start_at")
    @NotNull(message = "开始时间不能为空")
    @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime startAt;

    @TableField("end_at")
    @NotNull(message = "结束时间不能为空")
    @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime endAt;

    @TableField("status")
    @NotNull(message = "状态不能为空")
    @Schema(description = "状态：0未开始，1进行中，2已结束", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer status;

    @TableField("total_participants")
    @Schema(description = "总参与人数")
    private Integer totalParticipants;

    @TableField("completed_count")
    @Schema(description = "完成人数")
    private Integer completedCount;

    @TableField("completion_rate")
    @Schema(description = "完成率（%），保留2位小数")
    private Double completionRate;

    @TableField("create_time")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField("update_time")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @TableField("del_flag")
    @Schema(description = "删除标志：0-存在，1-删除")
    private Integer delFlag;
}
